import Alert from "./alert.vue";
import Vue from 'vue';
//Vue提供extend函数，返回构造函数
let AlertConstructor = Vue.extend(Alert);
let alert = (option) => {
  let instance = new AlertConstructor();
  instance.$mount(document.createElement("div"));
  document.body.appendChild(instance.$el);
  instance.show = true;
  if (option.title) {
    instance.title = option.title;
  }
  if (option.content) {
    instance.content = option.content
  }
  if (option.confirm) {
    instance.confirm = option.confirm
  }
}
export default alert;